<template>
	<view class="container">
		<view class="box" @click="showPopup">
			{{ name }}
		</view>
		<xy-area-choose ref="xyAreaChoose" @select-area="selectAreaClick"></xy-area-choose>
	</view>	
</template>

<script>

	export default {
		data() {
			return {
				name: '点我弹出地址选择器'
			}
		},
		onLoad() {
		},
		methods: {
			showPopup() {
				this.$refs.xyAreaChoose.open()
			},
			selectAreaClick(address) {
				console.log('address',address);
				this.name = address.province + ' ' + address.city + ' ' + address.area
			},
		},
		
	}
</script>

<style lang="scss" scoped>
	.container {
		.box {
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 20px;
			background-color: #acd;
			margin-top: 300px;
		}
	}
</style>
